<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .full {
            height: 100%;
            width: 100%;
        }
    </style>
    <script src="node_modules/jquery/dist/jquery.js"></script>
    <script src="dist/1.0.0/midway/midway.umd.js"></script>
    <script src="dist/1.0.0/midway/facade.umd.js"></script>
</head>
<body class="full">
<div>
    <button onclick="changeData()">变数据</button>
</div>

<div style="background-color: aquamarine;" class="full" id="app"></div>
<div style="background-color: cadetblue" class="full" id="demo"></div>

<script>
    let compare;
    Midware.globalConfig({
        LanguageBasePath: "ref/languages",
    });
    Midware.startup({async: true});
    Midway.config({

        BundlePath: "ref/bundles"
    });
    Midway.runMidway().done(function () {
        let demo = new Midway.Bundle({
            el: "#demo",
            launcher: "Compare",
            model: {

            }
        });

        demo.start();
        compare = new Midway.Bundle({
            el: "#app",
            launcher: "Compare",
            modelUrl: "http://localhost:63342/Midway/questions/61eb2477-3ee5-4469-b81a-50846c496385.pkg/main.xml"
        });
        compare.start();
    });
    /*if(window.Midway) {
     //初始化Midway
     Midway.runMidway();
     //启动一个组件
     var app = new Midway.Launcher({
     el: "#app",
     launcher: "demo"
     });
     app.start();
     //启动另外一个组件
     var demo = new Midway.Launcher({
     el: "#demo",
     launcher: "app"
     });
     demo.start();
     }*/

    function changeData() {
        compare.resetModel("http://localhost:63342/Midway/questions/68d726c2-98b4-43f6-95e6-a52895f54b8e.pkg/main.xml")
    }

</script>
</body>
</html>